<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      display: grid;
      /* 指定列宽行高、网格线名字 */
      grid-template-columns: [c1] 100px [c2] 100px [c3] 100px [c4];
      grid-template-rows: [r1] 100px [r2] 100px [r3] 100px [r4];
      grid-template-areas: 'a b c''d e f''j h i';
    }

    .box .item {
      background-color: #ccc;
    }

    /* grid-area属性指定项目放在哪一个区域。 */
    /* .box .item.item-2 {
      background-color: red;
      grid-area: e;
    } */
    /* grid-area属性还可用作grid-row-start、grid-column-start、grid-row-end、grid-column-end的合并简写形式，直接指定项目的位置。 */
    /* grid-area: <row-start> / <column-start> / <row-end> / <column-end>; */
    .box .item.item-2 {
      background-color: red;
      grid-area: r2 / c2 / r3 / c3;
    }
  </style>
</head>
<body>
  <div class="box">
    <div class="item item-1">1</div>
    <div class="item item-2">2</div>
    <div class="item item-3">3</div>
    <div class="item item-4">4</div>
    <div class="item item-5">5</div>
    <div class="item item-6">6</div>
    <div class="item item-7">7</div>
    <div class="item item-8">8</div>
    <div class="item item-9">9</div>
  </div>
</body>
</html>